package com.huashi.dealer.modular.business.goods.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * Store端商品评论详情VO
 *
 * @author 谭陈强
 * @since 2025-08-07
 */
@Data
@Schema(description = "Store端商品评论详情VO")
public class StoreCommentDetailVo {

    /**
     * 评论ID
     */
    @Schema(description = "评论ID")
    private Long commentId;

    /**
     * 用户信息
     */
    @Schema(description = "用户信息")
    private UserVo user;

    /**
     * 订单商品信息
     */
    @Schema(description = "订单商品信息")
    private OrderGoodsVo orderGoods;

    /**
     * 评分：10好评，20中评，30差评
     */
    @Schema(description = "评分：10好评，20中评，30差评")
    private Integer score;

    /**
     * 评价内容
     */
    @Schema(description = "评价内容")
    private String content;

    /**
     * 是否有图片
     */
    @Schema(description = "是否有图片")
    private Boolean isPicture;

    /**
     * 显示状态：1显示，0隐藏
     */
    @Schema(description = "显示状态：1显示，0隐藏")
    private Integer status;

    /**
     * 评价排序
     */
    @Schema(description = "评价排序")
    private Integer sort;

    /**
     * 评价图片列表
     */
    @Schema(description = "评价图片列表")
    private List<CommentImageVo> images;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private LocalDateTime createTime;

    /**
     * 用户VO
     */
    @Data
    @Schema(description = "用户VO")
    public static class UserVo {
        /**
         * 用户ID
         */
        @Schema(description = "用户ID")
        private Long userId;

        /**
         * 用户昵称
         */
        @Schema(description = "用户昵称")
        private String nickName;
    }

    /**
     * 订单商品VO
     */
    @Data
    @Schema(description = "订单商品VO")
    public static class OrderGoodsVo {
        /**
         * 商品名称
         */
        @Schema(description = "商品名称")
        private String goodsName;

        /**
         * 商品图片
         */
        @Schema(description = "商品图片")
        private ImageVo image;
    }

    /**
     * 图片VO
     */
    @Data
    @Schema(description = "图片VO")
    public static class ImageVo {
        /**
         * 图片ID
         */
        @Schema(description = "图片ID")
        private Long imageId;

        /**
         * 文件路径
         */
        @Schema(description = "文件路径")
        private String filePath;
    }

    /**
     * 评论图片VO
     */
    @Data
    @Schema(description = "评论图片VO")
    public static class CommentImageVo {
        /**
         * 图片ID
         */
        @Schema(description = "图片ID")
        private Long imageId;

        /**
         * 文件路径
         */
        @Schema(description = "文件路径")
        private String filePath;

        /**
         * 文件名
         */
        @Schema(description = "文件名")
        private String fileName;
    }
}
